home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-01 / tcoop10a.zip / DOC.ZIP / PLAY.DOC < prev    next >
Text File  |  1991-11-20  |  4KB  |  104 lines

  1. PLAY.DOC        11/15/91        Copyright (c) 1991 by James S. Clark
  2. ==========================================================================
  3. PLAY
  4. Play Class
  5. --------------------------------------------------------------------------
  6. Class Name                      Play
  7. Superclass                      Sound
  8. Category                        Sound
  9. Other classes referenced        <none>
  10. Other catagories referenced     <none>
  11. Used by                         Effect
  12. Inherited by                    <none>
  13.  
  14. Declaration                     Play    *play
  15.  
  16. Instance Variables
  17.                                 int     status;
  18.                                 int     mode;
  19.                                 int     tempo;
  20.                                 int     octave;
  21. Instance Methods
  22.                                 Play    ();
  23.                                 ~Play   ();
  24.                                 void    start   ();
  25.                                 void    stop    ();
  26.                                 void    string  (char *);
  27. --------------------------------------------------------------------------
  28. GENERAL DESCRIPTION
  29.  
  30. The Play Class provides the capability for playing music through the PC's
  31. built-in speaker, by entering characters string representations of the
  32. music.  The music is encoded using the same technique as in Microsoft
  33. Basic or for ASCII music.  A summary of the ANSII music commands that are
  34. accepted by Play are listed in the appendix at the end of this document.
  35.  
  36. The Play Class is derived from the Sound Class and will automatically
  37. initialize the sound system when an instance of Play is created.  For the
  38. reason, do NOT create more than one instance of the Play Class at any
  39. given time.
  40.  
  41. --------------------------------------------------------------------------
  42. VARIABLES
  43.  
  44. int     status;
  45.         Current status of the play system.  0 = inactive, 1 = active
  46.  
  47. int     mode;
  48.         Current mode of the play system. 0 = background, 1 = foreground
  49.  
  50. int     tempo;
  51.         The current tempo in beats per minute.  Range is 60 to 240.  The
  52.         default is 120.
  53.  
  54. int     octave;
  55.         The current octave.  The range is 0 to 7.  The default is 3.
  56.  
  57. --------------------------------------------------------------------------
  58. METHODS
  59.  
  60. Play    ();
  61.         Creates a new instance of the Play Class and initializes the
  62.         sound system.
  63.  
  64. ~Play   ();
  65.         Removes the sound system from memory and destroys the instance.
  66.  
  67. void    start   ();
  68.         Resumes playing the music if tones are available.
  69.  
  70. void    stop    ();
  71.         Stops playing the music.  Play can resume by using start.
  72.  
  73. void    string  (char *);
  74.         Translates an ASCII play string into a series of tones, and sends
  75.         them to the sound system.  Use this command to feed your music
  76.         into the player.
  77.  
  78. --------------------------------------------------------------------------
  79. APPENDIX A:
  80.  
  81. LIST OF ANSI MUSIC COMMANDS
  82.  
  83. A-G     Note values in the scale
  84. #,+     makes a note sharp                b,-     makes a note flat
  85. .       makes a note dotted
  86. Lxx     length 1-64 of notes 4=1/4 note
  87. MF      music in foreground               MB      music in background
  88. MN      music normal, 7/8 of total        ML      Music legato, 8/8 of total
  89. MS      Music staccato, 3/4 of total
  90. Ox      set octave 0-7, default = 3       Pxx     Pause, range 0-64
  91. Txxx    sets tempo 32-255, default=120
  92. >       next higher octave                <       next lower octave
  93. $$      string terminator                 |       measure separator
  94.  
  95. EXAMPLES:
  96.  
  97. A#16.                   A-sharp dotted sixteeth note
  98. Bb8                     B-flat eight note
  99. ML|L4|CDEFG>ABC$$       C-scale up in legato quarter notes
  100.  
  101. --------------------------------------------------------------------------
  102. PLAY.DOC                        Copyright (c) 1991 by James S. Clark
  103. ==========================================================================
  104.